<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%-- <%@ page session="false" %> --%>
<%@page pageEncoding="UTF-8"%>
<html>
<head>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/resources/jsapi.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/resources/jquery-1.8.2.js"></script>
<script type="text/javascript">
	google.load("visualization", "1", {packages:["corechart"]});
	// Set a callback to run when the Google Visualization API is loaded.
	google.setOnLoadCallback(drawChart);

	function drawChart() {
		var jstest = {
				  "cols": [
				           {"id":"","label":"Topping","pattern":"","type":"string"},
				           {"id":"","label":"Slices","pattern":"","type":"number"}
				         ],
				     "rows": [
				           {"c":[{"v":"Mushrooms","f":null},{"v":3,"f":null}]},
				           {"c":[{"v":"Onions","f":null},{"v":1,"f":null}]},
				           {"c":[{"v":"Olives","f":null},{"v":1,"f":null}]},
				           {"c":[{"v":"Zucchini","f":null},{"v":1,"f":null}]},
				           {"c":[{"v":"Pepperoni","f":null},{"v":2,"f":null}]}
				         ]
				   };
		
		
		var data = {"cols":[{"id":"Col1","label":"Column 1","type":"number"},{"id":"Col2","label":"Column 2","type":"number"},{"id":"Col3","label":"Column 3","type":"number"}],"rows":[{"c":[{"v":1234},{"f":"formatted text","v":224},{"v":934}]},{"c":[{"v":1234},{"f":"formatted text","v":224},{"v":934},{"v":3434},{"f":"formatted text","v":3224},{"v":2934}]},{"c":[{"v":1234},{"f":"formatted text","v":224},{"v":934},{"v":3434},{"f":"formatted text","v":3224},{"v":2934},{"v":1234},{"f":"formatted text","v":324},{"v":4534}]},{"c":[{"v":1234},{"f":"formatted text","v":224},{"v":934},{"v":3434},{"f":"formatted text","v":3224},{"v":2934},{"v":1234},{"f":"formatted text","v":324},{"v":4534},{"v":1554},{"f":"formatted text","v":243},{"v":784}]},{"c":[{"v":1234},{"f":"formatted text","v":224},{"v":934},{"v":3434},{"f":"formatted text","v":3224},{"v":2934},{"v":1234},{"f":"formatted text","v":324},{"v":4534},{"v":1554},{"f":"formatted text","v":243},{"v":784},{"v":3234},{"f":"formatted text","v":224},{"v":934}]}]};
		var jsonData = $.ajax({
			url : "getData",
			dataType : "json",
			async : false
		}).success(function() { alert("second success"); })
		  .error(function() { alert("error"); })
		  .complete(function() { alert("complete"); });
	
		var test = document.getElementById('test');
		test.innerHTML = 'dfsdfSDfASDJFDFKGKSDFJGKJSDFKGJKSDFJ';
		test.appendChild(document.createTextNode(jsonData.responseText));
		// Create our data table out of JSON data loaded from server.
		var data = new google.visualization.DataTable(jsonData.responseText);

		var options = {
			title : 'Company Performance'
		};

		var chart = new google.visualization.LineChart(document
				.getElementById('chart_div'));
		chart.draw(data, options);
	}
</script>
<title>Home</title>
</head>
<body>
	<h1>Hello world!</h1>

	<div id="chart_div" style="width: 900px; height: 500px;"></div>
	<div id="test">  terr</div>
</body>
</html>

<P>The time on the server is ${serverTime}.</P>
</body>
</html>

<script type="text/javascript">
var data = 
{"cols":[{"id":"Col1","label":"Column1","type":"string"},{"id":"Col2","label":"Column2","type":"string"},{"id":"Col3","label":"Column3","type":"string"}],"rows":[{"c":[{"v":"1234"},{"f":"formatted text","v":"224"},{"v":"934"}]},{"c":[{"v":"1234"},{"f":"formatted text","v":"224"},{"v":"934"},{"v":"3434"},{"f":"formatted text","v":"3224"},{"v":"2934"}]},{"c":[{"v":"1234"},{"f":"formatted text","v":"224"},{"v":"934"},{"v":"3434"},{"f":"formatted text","v":"3224"},{"v":"2934"},{"v":"1234"},{"f":"formatted text","v":"324"},{"v":"4534"}]},{"c":[{"v":"1234"},{"f":"formatted text","v":"224"},{"v":"934"},{"v":"3434"},{"f":"formatted text","v":"3224"},{"v":"2934"},{"v":"1234"},{"f":"formatted text","v":"324"},{"v":"4534"},{"v":"1554"},{"f":"formatted text","v":"243"},{"v":"784"}]},{"c":[{"v":"1234"},{"f":"formatted text","v":"224"},{"v":"934"},{"v":"3434"},{"f":"formattedtext","v":"3224"},{"v":"2934"},{"v":"1234"},{"f":"formatted text","v":"324"},{"v":"4534"},{"v":"1554"},{"f":"formattedtext","v":"243"},{"v":"784"},{"v":"3234"},{"f":"formattedtext","v":"224"},{"v":"934"}]}]};
</script>
